The HDF_DFAN_GETDESC procedure reads the description for the given tag and reference number in an HDF file.
HDF_DFAN_GETDESC, Filename, Tag, Ref, Description [, /STRING]
A scalar string containing the name of the file to be read.
The tag number.
The reference number.
A named variable in which the description is returned as a vector of bytes.
If a description does not exist, the Description variable will contain either a 0L (long-integer zero) or a blank string, and a warning message will be printed. Warning messages can be suppressed by setting the !QUIET system variable to a non-zero value.
Set this keyword to return the description as a string rather than a vector of bytes.
desc1 = 'FILE DESCRIPTION NUMBER 1'
tag_image = 302
file = 'DEMOdesc.hdf'
fid = HDF_OPEN(file, /CREATE)
HDF_DFR8_ADDIMAGE, file, DIST(10)
HDF_DFAN_PUTDESC, file, tag_image, HDF_DFR8_LASTREF(), desc1
; Read the description and return a vector of bytes:
HDF_DFAN_GETDESC, file, tag_image, HDF_DFR8_LASTREF(), out_desc1
HELP, out_desc1
PRINT, STRING(out_desc1)
; Read the description and return an IDL string variable:
HDF_DFAN_GETDESC, file, tag_image, HDF_DFR8_LASTREF(), $
out_desc2, /STRING
HELP, out_desc2
HDF_CLOSE, fid
OUT_DESC1 BYTE = Array(25)
FILE DESCRIPTION NUMBER 1
OUT_DESC2 STRING = 'FILE DESCRIPTION NUMBER 1'
4.0 |
Introduced |